<div class="navbar navbar-fixed-top">
	
	<div>
		<div class="navbar-inner" id="cesdedLogo" role="banner">
			<a href="http://www.cesed.br/portal/"><img style="margin: 20px" src="${resource(dir: 'images', file: 'logo.png')}" alt="Cesed"/></a>
		</div>
		
	</div>
	
	<div class="navbar-inner">
    
		<div class="container-fluid">
			<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
			</a>
      
			<div class="brand">Alocador de Horários</div>
			
			<sec:ifLoggedIn>
			<div class="btn-group pull-right">
				<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">

					<sec:ifAllGranted roles="ROLE_ADMIN">
						<i class="icon-user"></i> Administrador
						<span class="caret"></span>
					</sec:ifAllGranted>
					
					<sec:ifAllGranted roles="ROLE_COORDENADOR">
						<i class="icon-user"></i> Coordenador
						<span class="caret"></span>
					</sec:ifAllGranted>
					
					<sec:ifAllGranted roles="ROLE_PROFESSOR">
						<i class="icon-user"></i> Professor
						<span class="caret"></span>
					</sec:ifAllGranted>
								
					<sec:ifAllGranted roles="ROLE_USUARIO">
						<i class="icon-user"></i> Usuário
						<span class="caret"></span>
					</sec:ifAllGranted>

				</a>
				<ul class="dropdown-menu">
<%--					<li><g:link controller="usuario" action="edit" params="${[username:springSecurityService?.principal?.username]}">Perfil</g:link></li>--%>
					<li><g:link controller="usuario" action="show" params="${[username:springSecurityService?.principal?.username]}">Perfil</g:link></li>
					<sec:ifAllGranted roles="ROLE_ADMIN">
						<li><g:link controller="coordenador" action="create">Cad. de Coordenador</g:link></li>
						<li><g:link controller="professor" action="create">Cad. de Professor</g:link></li>
					</sec:ifAllGranted>

					<sec:ifAllGranted roles="ROLE_COORDENADOR">
						<li><g:link controller="professor" action="create">Cad. de Professor</g:link></li>
					</sec:ifAllGranted>
					
					<li class="divider"></li>
				   	<li><g:link controller="logout">Sair</g:link></li>
				</ul>
			</div>
			</sec:ifLoggedIn>
			
			<sec:ifNotLoggedIn>
			<ul class="nav pull-right">
				<li><g:link controller="login">Entre</g:link></li>
				<li class="divider-vertical"></li>
				<li><g:link controller="usuario" action="create">Registre-se</g:link></li>
			</ul>      
			</sec:ifNotLoggedIn>
			
			<div class="nav-collapse">
				<ul class="nav">
					<li class="active"><g:link controller="site">Início</g:link></li>
					<li><a href="#about">Sobre</a></li>
					<li><a href="#contact">Contato</a></li>
					<g:if test="${session['carrinho']}">
						<li><g:link controller="site" action="carrinho">Carrinho</g:link></li>
					</g:if>
				</ul>
			</div>
			
		</div>
	</div>
</div>